#include <STC15F2K60S2.H>
#include <intrins.H>

#define Y4 P2 = 0X9F&(P2|0XE0);
#define Y5 P2 = 0XBF&(P2|0XE0);
#define Y6 P2 = 0XDF&(P2|0XE0);
#define Y7 P2 = 0XFF&(P2|0XE0);

int i;

void Delay500ms();

int main()
{
	Y4 P0 = 0XFF;
	Y5 P0 = 0X00;
	Y4 P0 = 0XFE;
	Delay500ms();
	while(1)
	{
		for(i=0;i<8;i++)
		{
			Y4 P0 = P0<<1;
			Y4 P0 = P0+0X01;
			Delay500ms();
		}
		P0 =0XFE;
		Delay500ms();
	}
}

void Delay500ms()		//@11.0592MHz
{
	unsigned char i, j, k;

	_nop_();
	_nop_();
	i = 22;
	j = 3;
	k = 227;
	do
	{
		do
		{
			while (--k);
		} while (--j);
	} while (--i);
}

